package base;

import java.util.Objects;

public class Student {
    //属性
    private String sid;
    private String sName;
    private int sAge;

    //构造方法
    public Student() {
    }

    public Student(String sid,String sName,int sAge) {
        this.sid = sid;
        this.sName = sName;
        this.sAge = sAge;
    }

//    属性方法


    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getsName() {
        return sName;
    }

    public void setsName(String sName) {
        this.sName = sName;
    }

    public int getsAge() {
        return sAge;
    }

    public void setsAge(int sAge) {
        this.sAge = sAge;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return sAge == student.sAge && Objects.equals(sid, student.sid) && Objects.equals(sName, student.sName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(sid, sName, sAge);
    }

    @Override
    public String toString() {
        return "Student{" +
                "sid='" + sid + '\'' +
                ", sName='" + sName + '\'' +
                ", sAge=" + sAge +
                '}';
    }
}
